// @ts-ignore
/* eslint-disable */
import request from '@/request'

/** 创建用户 POST /api/add */
export async function addUserUsingPost(body: API.User, options?: { [key: string]: any }) {
  return request<API.BaseResponseLong_>('/api/add', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  })
}

/** 删除用户 POST /api/delete */
export async function deleteUserUsingPost(body: number, options?: { [key: string]: any }) {
  return request<API.BaseResponseBoolean_>('/api/delete', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  })
}

/** 获取用户信息 POST /api/get */
export async function getUserUsingPost(body: number, options?: { [key: string]: any }) {
  return request<API.BaseResponseUser_>('/api/get', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  })
}

/** 获取当前登录用户 POST /api/get/login */
export async function getLoginUserUsingPost(options?: { [key: string]: any }) {
  return request<API.BaseResponseLoginUserVo_>('/api/get/login', {
    method: 'POST',
    ...(options || {}),
  })
}

/** 获取脱敏后的用户数据 POST /api/get/vo */
export async function getUserVoUsingPost(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.getUserVoUsingPOSTParams,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseUserVO_>('/api/get/vo', {
    method: 'POST',
    params: {
      ...params,
    },
    ...(options || {}),
  })
}

/** 分页查询 POST /api/list/page */
export async function listUserByPageUsingPost(
  body: API.UserQueryRequest,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponsePageUser_>('/api/list/page', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  })
}

/** 用户登录 POST /api/login */
export async function userLoginUsingPost(
  body: API.UserLoginRequest,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseLoginUserVo_>('/api/login', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  })
}

/** 用户注销 POST /api/logout */
export async function userLogoutUsingPost(options?: { [key: string]: any }) {
  return request<API.BaseResponseBoolean_>('/api/logout', {
    method: 'POST',
    ...(options || {}),
  })
}

/** 用户注册 POST /api/register */
export async function userRegisterUsingPost(
  body: API.UserRegisterRequest,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseLong_>('/api/register', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  })
}
